<template>
    <div>
        <h2>登录</h2>
        <table class="table-table">
            <tr>
                <td>账号</td>
                <td>
                    <input type="text" v-model="data.zh">
                </td>
            </tr>
                 <tr>
                <td>密码</td>
                <td>
                    <input type="password" v-model="data.mm">
                </td>
            </tr>
       
       
               <tr>
                <td></td>
                <td>
                    <input type="button" value="登录" @click="add">
                </td>
            </tr>
        </table>

    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref,onMounted } from 'vue';



const data=ref({
 zh:"",
 mm:""
})





const add=()=>{


    axios.get("https://localhost:7209/api/logindl/dl",{params:data.value}).then(res=>{
        if(res.data==1){
            alert("登录成功");
            location.href="/bfxs"

        }else if(res.data==-1){
            alert("密码错误")
        }else{
            alert("账号不存在")
        }
    })
}
</script>

<style scoped>

</style>